package com.cat.orm.core.db.factory;

import com.cat.orm.core.base.IBaseData;
import com.cat.orm.core.db.dao.CommonDao;
import com.cat.orm.core.db.dao.IDao;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * 公共dao工厂
 * @author Jeremy
 */
public class CommonDaoFactory implements DaoFactory {

    @Override
    public Class<? extends IDao> daoClazz() {
        return CommonDao.class;
    }

    public <T extends IBaseData> IDao<T> createDao(Class<T> clazz, JdbcTemplate jdbcTemplate, String tableName) {
        return new CommonDao(clazz, jdbcTemplate);
    }
}